package part17;

import java.util.SortedMap;
import java.util.TreeMap;

/**
 * @author wcj
 * @Date 2021/6/1 19:56
 * @Version 1.0
 */
public class Part1712 {

    /**
     * sortedMap,整体的方法和map差不多，类似于sortedSet
     *
     * @param args
     */
    public static void main(String[] args) {
        SortedMap<String, String> sortedMap = new TreeMap<>();
        sortedMap.put("wcj", "bss");
        sortedMap.put("ysj", "ylb");
        sortedMap.put("wgp", "lji");
        System.out.println(sortedMap);
        System.out.println(sortedMap.firstKey());
        System.out.println(sortedMap.lastKey());
        System.out.println(sortedMap.subMap("wcj", "wgp"));
    }
}
